package com.medical.app.controller;

import com.medical.app.common.dto.DepartmentDto;
import com.medical.app.service.DepartmentService;
import com.qf.medical.response.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Date : 2024/4/30 上午11:39
 * @Created by Lang
 * @ProjectName : medical-appointment-registration
 */
@Api(tags = "门诊模块api")
@RestController
@RequestMapping("/department")
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

    @GetMapping("/list/byHospital")
    @ApiOperation(value = "门诊列表")
    public ResponseEntity<List<DepartmentDto>> getDepartmentByHospital(Long hospitalId) {
        List<DepartmentDto> list =  departmentService.listByHospital(hospitalId);
        return ResponseEntity.success(list);
    }
}
